#pragma once
#include "MultiMedia.h"
#include <algorithm>

using namespace std;

class MultiMediaRegister
{
private:
	MultiMediaV *p;  //Pekare till ett multimediavektorobjekt
	int quit;        //Flagga

	void Add();
	void Delete();
	void List();
	void WriteToFile();
	void ReadFromFile();
	void Search();
	void SortByT();
	void SortByY();
	//bool sortByTitle (const MultiMedia &vop, const MultiMedia &hop) {return &vop.title < &hop.title;}
	//bool sortByYear (const MultiMedia &vop, const MultiMedia &hop) {return &vop.year < &hop.year;}

public:
	MultiMediaRegister(MultiMediaV *pek);
	int Quit() { return quit; }

	friend ostream& operator<<(ostream& stream, MultiMediaRegister& hop);
	friend istream& operator>>(istream& stream, MultiMediaRegister& hop);

	~MultiMediaRegister(void);
};

